export default {
  name: '弹框散点层',
  code: 'custom_map_group_ifreamMarker',
  version: '1.0.0',
  config: [
    {
      name: '默认配置',
      code: 'default',
      children: [
        {
          name: '显示类型',
          code: 'content',
          type: 'ChangeConfig',
          value: {
            type: 'spot',
            // 散点value
            shape: 'location',
            colors: [
              {
                id: 1000,
                start: 1,
                end: 1,
                color: '#3399CC',
              },
            ],
            // 图标value
            imageUrl: '',
          },
          enumValue: [
            {
              key: '散点',
              value: 'spot',
              change: [
                {
                  name: '散点样式',
                  code: 'shape',
                  type: 'FontSelect',
                  enumValue: [
                    { name: '类型1', img: 'location' },
                    { name: '类型2', img: 'markercircle-copy' },
                    { name: '类型3', img: 'triangle' },
                    { name: '类型4', img: 'square' },
                    { name: '类型5', img: 'diamond' },
                    { name: '类型6', img: 'markeryuandian' },
                  ],
                },
                {
                  name: '散点颜色',
                  code: 'colors',
                  type: 'RangeColors',
                  min: 1,
                  template: {
                    id: Math.floor(Math.random() * 1000),
                    start: 1,
                    end: 1,
                    color: '#3399CC',
                  },
                },
              ],
            },
            {
              key: '图标',
              value: 'image',
              change: [
                {
                  name: '图标图片',
                  code: 'imageUrl',
                  type: 'ImgUpdate',
                },
              ],
            },
          ],
        },
        {
          name: '标注中心设置',
          code: 'position',
          value: 'center',
          type: 'Radio',
          enumValue: [
            {
              key: '图标中心点',
              value: 'center',
            },
            {
              key: '图标底部中心',
              value: 'bottom',
            },
          ],
        },
        {
          name: '图标尺寸最小值',
          code: 'minSize',
          value: 15,
          min: 1,
          max: 999,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '图标尺寸最大值',
          code: 'maxSize',
          value: 30,
          min: 1,
          max: 999,
          type: 'InputNumber',
          unit: 'px',
        },
      ],
    },
    {
      name: '弹框样式',
      code: 'popup',
      children: [
        {
          name: '弹框宽度',
          code: 'width',
          min: 0,
          value: 500,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '弹框高度',
          code: 'height',
          min: 0,
          value: 300,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '弹框距上边距离',
          code: 'top',
          min: 0,
          value: 100,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '弹框距右边距离',
          code: 'right',
          value: 100,
          min: 0,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '弹框背景色',
          code: 'backgroundColor',
          value: '#FFF',
          type: 'ColorSelector',
        },
        {
          name: '边框线条色',
          code: 'borderColor',
          value: '#3399CC',
          type: 'ColorSelector',
        },
        {
          name: '边框线条粗细',
          code: 'borderWidth',
          min: 0,
          value: 3,
          type: 'InputNumber',
          unit: 'px',
        },
      ],
    },
    {
      name: '提示框样式',
      code: 'tooltip',
      children: [
        {
          name: '文本设置',
          code: 'font',
          type: 'FontGroup',
          value: {
            fontSize: 14,
            fontFamily: 'siyuan',
            color: '#000',
            fontWeight: 'bold',
          },
        },
        {
          name: '背景色',
          code: 'backgroundColor',
          value: '#FFF',
          type: 'ColorSelector',
        },
        {
          name: '边框线条色',
          code: 'borderColor',
          value: '#3399CC',
          type: 'ColorSelector',
        },
        {
          name: '边框线条粗细',
          code: 'borderWidth',
          min: 0,
          value: 3,
          type: 'InputNumber',
          unit: 'px',
        },
      ],
    },
    {
      name: '交互设置',
      code: 'action',
      children: [
        {
          name: '提示框设置',
          code: 'show',
          value: 'hover',
          type: 'Radio',
          enumValue: [
            {
              key: '无提示',
              value: 'hide',
            },
            {
              key: '提示一直存在',
              value: 'always',
            },
            {
              key: '鼠标划过提示',
              value: 'hover',
            },
          ],
        },
      ],
    },
  ],
  data: {
    field: [
      { name: 'lng', mapper: 'lng' },
      { name: 'lat', mapper: 'lat' },
      { name: 'value', mapper: 'count', optional: true },
      { name: 'info', mapper: 'text', optional: true },
      { name: 'url', mapper: 'url', optional: true },
    ],
    type: 1,
    value: JSON.stringify([
      {
        lat: 31.395141,
        lng: 100.180187,
        count: 87,
        text: '文字信息对应数据info;可用分号换行',
        url: 'http://monet.urban-computing.cn/monet-doc/',
      },
      {
        lat: 37.314268,
        lng: 102.033458,
        count: 58,
        text: '散点支持弹窗交互',
        url: 'http://monet.urban-computing.cn/#/screen?key=b89e9e9953f74d25b1295d7696e2db0c',
      },
      { lat: 35.517994, lng: 106.050051, count: 51 },
      { lat: 37.509955, lng: 108.07636, count: 36 },
      { lat: 39.308593, lng: 104.033371, count: 71 },
      { lat: 30.698055, lng: 110.81029, count: 29 },
      { lat: 40.698055, lng: 112.81029, count: 29 },
      { lat: 41.443159, lng: 114.052512, count: 12 },
      { lat: 43.514083, lng: 126.066373, count: 73 },
      { lat: 25.516678, lng: 114.059902, count: 2 },
      { lat: 28.512241, lng: 112.069421, count: 21 },
      { lat: 29.513178, lng: 103.059847, count: 47 },
      { lat: 30.755745, lng: 105.783377, count: 77 },
    ]),
  },
  events: {
    click: {
      description: '标签点击响应事件',
      fields: {
        lng: {
          mapper: '',
          description: '经度',
          value: 116,
        },
        lat: {
          mapper: '',
          description: '纬度',
          value: 39,
        },
      },
    },
  },
};
